/**
 * @author zhijun.guo
 * @create 2019-02-04 12:11
 **/
function Home() {
}

Home.inherit(Portlet);

Home.prototype.init = function (oComponent) {
    Home.base.init.call(this);
    this._component = oComponent;
}

Home.prototype.complete = function (oComponent) {
    var that = this;
    this._iframe = this._component.getElementById("pagecontent");
    this._resTable = this._component.getElementById("resTable");
    this._resTable.queryAndDisplay({},function(oTable, data, oResult){
        debugger;
        if(data.length > 0){
            that.selectResource(oTable.getRowByNum(0));
        }
        debugger;
    });
}

Home.prototype.selectResource = function(oControl){
    $(".res-row",oControl.getParent().getParent().getHTML()).removeClass("res-row-sel");
    $(oControl.getHTML()).addClass("res-row-sel");
    var data = oControl.getRecord();
    if(!data.url) throw "url must not null!";
    this.openPage(data.url);
}

Home.prototype.openPage = function(url){
    debugger;
    this._iframe.setSrc("/webapp/App.html?g_sPath='"+url+"'");
}

/**
 * 注册方法
 */
Home.HANDLER = {}

Home.E_HANDLER = {
    "MSG_EXPORT_ALL": null
};